//
//  PicWallCollectionViewCell.m
//  CarFace
//
//  Created by dlios on 15-3-28.
//  Copyright (c) 2015年 蓝鸥科技. All rights reserved.
//

#import "PicWallCollectionViewCell.h"

@implementation PicWallCollectionViewCell
- (void)dealloc
{
    [_imageView release];
    [_picAdress release];
    [super dealloc];
    
}


-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.imageView = [[UIImageView alloc]init];
//        self.imageView.backgroundColor = [UIColor magentaColor];
        [self.contentView addSubview:self.imageView];
        [_imageView release];
    }
    return self;
}


-(void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes
{
    self.imageView.frame = layoutAttributes.bounds;
}


-(void)setPicAdress:(NSString *)picAdress
{
    if (_picAdress != picAdress) {
        [_picAdress release];
        _picAdress = [picAdress retain];

    }

    picAdress = [picAdress stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    NSURL *url = [NSURL URLWithString:picAdress];
    [self.imageView setImageWithURL:url];
    
    
}


@end
